<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
    <script src="js/api.js"> </script>
</head>
<style>
    html,body{
        padding:0;
        margin:0;
        background:#eeeeee;
    }
    #header{
        position:fixed;
        top:0;
        left:0;
        width:100%;
        height:60px;
        text-align:center;
        line-height:60px;
        background:#ffffff;
    }
    #content{
        padding-top:100px;
        width:100%;
    }
    #close{
        width:30px;
        height:30px;
        position:absolute;
        left:20px;
        top:10px;
    }
    #title{
        font-size:16px;
        font-weight: bold;
    }
</style>
<body>
<div id="header">
    <img src="images/icon_left.png" id="close" onclick="api.closeWin();"/>
    <div id="title">地方豆腐干</div>
</div>
<div id="content">
豆腐干豆腐干
</div>
<button onclick="openWin();">打开一个新页面</button>
<script>
    function ready(){
        var param = api.getWinParam();
        param = JSON.parse(param);
        $api.html($api.byId('title'),param.name);
        $api.html($api.byId('content'),"从上一个页面传过来的内容:"+param.data);
    }
    ready();
    function openWin(){
        api.openWin('page.html','hello','test');
    }
</script>
</body>
</html>
